
/* First created by JCasGen Sat Apr 02 10:57:57 CEST 2011 */
package uima.stanford.types;

import org.apache.uima.jcas.JCas;
import org.apache.uima.jcas.JCasRegistry;
import org.apache.uima.cas.impl.CASImpl;
import org.apache.uima.cas.impl.FSGenerator;
import org.apache.uima.cas.FeatureStructure;
import org.apache.uima.cas.impl.TypeImpl;
import org.apache.uima.cas.Type;
import org.apache.uima.cas.impl.FeatureImpl;
import org.apache.uima.cas.Feature;
import org.apache.uima.jcas.tcas.Annotation_Type;

/** 
 * Updated by JCasGen Sat Apr 02 17:34:51 CEST 2011
 * @generated */
public class UIMAConstituent_Type extends Annotation_Type {
  /** @generated */
  protected FSGenerator getFSGenerator() {return fsGenerator;}
  /** @generated */
  private final FSGenerator fsGenerator = 
    new FSGenerator() {
      public FeatureStructure createFS(int addr, CASImpl cas) {
  			 if (UIMAConstituent_Type.this.useExistingInstance) {
  			   // Return eq fs instance if already created
  		     FeatureStructure fs = UIMAConstituent_Type.this.jcas.getJfsFromCaddr(addr);
  		     if (null == fs) {
  		       fs = new UIMAConstituent(addr, UIMAConstituent_Type.this);
  			   UIMAConstituent_Type.this.jcas.putJfsFromCaddr(addr, fs);
  			   return fs;
  		     }
  		     return fs;
        } else return new UIMAConstituent(addr, UIMAConstituent_Type.this);
  	  }
    };
  /** @generated */
  public final static int typeIndexID = UIMAConstituent.typeIndexID;
  /** @generated 
     @modifiable */
  public final static boolean featOkTst = JCasRegistry.getFeatOkTst("uima.stanford.types.UIMAConstituent");
 
  /** @generated */
  final Feature casFeat_tag;
  /** @generated */
  final int     casFeatCode_tag;
  /** @generated */ 
  public String getTag(int addr) {
        if (featOkTst && casFeat_tag == null)
      jcas.throwFeatMissing("tag", "uima.stanford.types.UIMAConstituent");
    return ll_cas.ll_getStringValue(addr, casFeatCode_tag);
  }
  /** @generated */    
  public void setTag(int addr, String v) {
        if (featOkTst && casFeat_tag == null)
      jcas.throwFeatMissing("tag", "uima.stanford.types.UIMAConstituent");
    ll_cas.ll_setStringValue(addr, casFeatCode_tag, v);}
    
  
 
  /** @generated */
  final Feature casFeat_subConstituents;
  /** @generated */
  final int     casFeatCode_subConstituents;
  /** @generated */ 
  public int getSubConstituents(int addr) {
        if (featOkTst && casFeat_subConstituents == null)
      jcas.throwFeatMissing("subConstituents", "uima.stanford.types.UIMAConstituent");
    return ll_cas.ll_getRefValue(addr, casFeatCode_subConstituents);
  }
  /** @generated */    
  public void setSubConstituents(int addr, int v) {
        if (featOkTst && casFeat_subConstituents == null)
      jcas.throwFeatMissing("subConstituents", "uima.stanford.types.UIMAConstituent");
    ll_cas.ll_setRefValue(addr, casFeatCode_subConstituents, v);}
    
   /** @generated */
  public int getSubConstituents(int addr, int i) {
        if (featOkTst && casFeat_subConstituents == null)
      jcas.throwFeatMissing("subConstituents", "uima.stanford.types.UIMAConstituent");
    if (lowLevelTypeChecks)
      return ll_cas.ll_getRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_subConstituents), i, true);
    jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_subConstituents), i);
  return ll_cas.ll_getRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_subConstituents), i);
  }
   
  /** @generated */ 
  public void setSubConstituents(int addr, int i, int v) {
        if (featOkTst && casFeat_subConstituents == null)
      jcas.throwFeatMissing("subConstituents", "uima.stanford.types.UIMAConstituent");
    if (lowLevelTypeChecks)
      ll_cas.ll_setRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_subConstituents), i, v, true);
    jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_subConstituents), i);
    ll_cas.ll_setRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_subConstituents), i, v);
  }
 
 
  /** @generated */
  final Feature casFeat_token;
  /** @generated */
  final int     casFeatCode_token;
  /** @generated */ 
  public int getToken(int addr) {
        if (featOkTst && casFeat_token == null)
      jcas.throwFeatMissing("token", "uima.stanford.types.UIMAConstituent");
    return ll_cas.ll_getRefValue(addr, casFeatCode_token);
  }
  /** @generated */    
  public void setToken(int addr, int v) {
        if (featOkTst && casFeat_token == null)
      jcas.throwFeatMissing("token", "uima.stanford.types.UIMAConstituent");
    ll_cas.ll_setRefValue(addr, casFeatCode_token, v);}
    
  
 
  /** @generated */
  final Feature casFeat_isPos;
  /** @generated */
  final int     casFeatCode_isPos;
  /** @generated */ 
  public boolean getIsPos(int addr) {
        if (featOkTst && casFeat_isPos == null)
      jcas.throwFeatMissing("isPos", "uima.stanford.types.UIMAConstituent");
    return ll_cas.ll_getBooleanValue(addr, casFeatCode_isPos);
  }
  /** @generated */    
  public void setIsPos(int addr, boolean v) {
        if (featOkTst && casFeat_isPos == null)
      jcas.throwFeatMissing("isPos", "uima.stanford.types.UIMAConstituent");
    ll_cas.ll_setBooleanValue(addr, casFeatCode_isPos, v);}
    
  



  /** initialize variables to correspond with Cas Type and Features
	* @generated */
  public UIMAConstituent_Type(JCas jcas, Type casType) {
    super(jcas, casType);
    casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator());

 
    casFeat_tag = jcas.getRequiredFeatureDE(casType, "tag", "uima.cas.String", featOkTst);
    casFeatCode_tag  = (null == casFeat_tag) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_tag).getCode();

 
    casFeat_subConstituents = jcas.getRequiredFeatureDE(casType, "subConstituents", "uima.cas.FSArray", featOkTst);
    casFeatCode_subConstituents  = (null == casFeat_subConstituents) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_subConstituents).getCode();

 
    casFeat_token = jcas.getRequiredFeatureDE(casType, "token", "uima.stanford.types.UIMAToken", featOkTst);
    casFeatCode_token  = (null == casFeat_token) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_token).getCode();

 
    casFeat_isPos = jcas.getRequiredFeatureDE(casType, "isPos", "uima.cas.Boolean", featOkTst);
    casFeatCode_isPos  = (null == casFeat_isPos) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_isPos).getCode();

  }
}



    